# 工厂模式
class Persion:
    pass
class Student(Persion):
    pass
class Work(Persion):
    pass
class Teacher(Persion):
    pass
class Factory:
    def getPersion(self, p_type):
        if p_type == "w":
            return Work()
        elif p_type == "s":
            return Student()
        else:
            return Teacher()
f = Factory()
f.getPersion("w")
